import { head, last } from 'lodash'

export default {
  data() {
    return {
      yqtjVisible: false,
      yqtjTpl: null
    }
  },
  methods: {
    handleYqtjClick() {
      if (this.xxlhListIndexs.length > 1) {
        return this.$Notice.warning({
          title: '操作提示',
          desc: '此操作不支持选择多条线'
        })
      }
      const _data = this.xxlhList[this.xxlhListIndexs[0]]
      if (_data == null) {
        return this.$Notice.warning({
          title: '操作提示',
          desc: '没有可操作的数据'
        })
      }
      const _startTime = head(_data).name
      const _endTime = last(_data).name
      this.loadYqltjData({
        startTime: _startTime,
        endTime: _endTime
      })
      this.yqtjVisible = true
      this.yqtjTpl = 'HBar3d'
    },
    yqtjModalCancel() {
      this.yqtjVisible = false
      this.yqtjTpl = null
    }
  }
}
